package net.ys.bean;

/**
 * @author: NMY
 * @Date: 2021/8/2
 * @Time: 22:26
 */
public class EvenOdd implements Comparable {

    public EvenOdd(int num, int amount) {
        this.num = num;
        this.amount = amount;
    }

    private int num;
    private int amount;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    @Override
    public int compareTo(Object o) {
        EvenOdd oo = (EvenOdd) o;
        int otherAmount = oo.getAmount();
        return this.amount > otherAmount ? -1 : this.amount == otherAmount ? 0 : 1;
    }
}
